<style type="text/css">
.thumbnail
{
float:left;
margin:20px;
}
table,th,td
{
border:1px solid #D4D4D4;
border-collapse: collapse;
border-color: gray;
}
.text_line
{
clear:both;
}

   
</style>
<div style="float: left;width: 450px; height: 150px;">
<p><h3>Vị trí của CVgiasu.com</h3></p>
<p id="myId">&nbsp; Đảm bảo thông tin sinh viên cung cấp là chính xác</p>
<p>&nbsp; Đảm bảo thông tin từ phụ huynh cung cấp là chính xác</p>
<b>Tìm Kiếm :</b>
<form method="post">
<?php
$hanoiSchools = Zend_Registry::get('hanoiSchools');
echo "<select id='school' name='school' style='width: 130px;'>";
echo "<option value='all'>Tất cả các trường</option>";
foreach ($hanoiSchools as $key => $value) {
    echo "<option value='".$value."'>".$key."</option>";
}
echo "</select>";
?>
    
<script type="text/javascript">
  document.getElementById('school').value = "<?php echo $_POST['school'];?>";
</script>

<?php
$classes = Zend_Registry::get('classes');
echo "<select id='class' name='class' style='width: 130px;'>";
echo "<option value='0'>Tất cả các lớp</option>";
foreach ($classes as $key => $value) {
    echo "<option value='".$key."'>Lớp ".$key."</option>";
}
echo "</select>";
?>

<script type="text/javascript">
  document.getElementById('class').value = "<?php echo $_POST['class'];?>";
</script>
    
<select name="gender" id="gender" style='width: 130px;'>
    <option value="all">Tất cả giới tính</option>
    <option value="Nam">Nam</option>
    <option value="Nữ">Nữ</option>
</select>

<script type="text/javascript">
  document.getElementById('gender').value = "<?php echo $_POST['gender'];?>";
</script>

<input type="submit" value="Tìm" />
</form>
</div>
<div style="float: left;width: 450px; height: 150px;">
    <table style="float: right; width: 200; margin-top: 10px; border: 1px solid white;">
        <tr>
            <th colspan="2" align="center"><a href="<?php echo $this->url(array('controller'=>'student', 'action' => 'stat'),'default',true) ?>">Thống kê</a></th>
        </tr>
        <tr>
            <td>Số hồ sơ đã đăng ký</td>
            <td><span style="color:white; background-color: red; padding-left:5px;padding-right: 5px;"><?php echo $this->totalStudents->totalstudents ?></span></td>
        </tr>
        <tr>
            <td>Số đã đi dạy</td>
            <td><span style="color:white; background-color: red; padding-left:5px;padding-right: 5px;"><?php echo $this->totalTeached ?></span></td>
        </tr>
    </table>
</div>
<?php
foreach($this->data as $item)
{
    echo "<table width='430' class='thumbnail'>";
    
    echo "<tr>";
    echo "<td align='center' width= 30%>";
    echo "<b>MS: ".$item['id']."</b>";
    echo "</td>";
    echo "<td align='center' width= 70%>";
    echo "<a href='".$this->url(array('controller'=>'student', 'action'=>'hub', 'studentid' => $item['id']),null,true)."' >";
    echo "<b>".$item['username']."</b>";
    echo "</a>";
    echo "</td>";
    echo "</tr>";
    echo "<td rowspan='8' align='center'>";
    echo "<a href='".$this->url(array('controller'=>'student', 'action'=>'hub', 'studentid' => $item['id']),null,true)."' >";
    echo "<img src='".$this->baseURL()."/img/avatars/".$item['avatarname']."'  width='130' height='100' />";
    echo "</a>";
    echo "</td>";
    echo "<td>";
    echo "Giới tính: ".$item['gender']."&emsp;Năm ".$item['year'];
    echo "</td>";
    echo "</tr>";
    
    echo "<tr>";
    echo "<td>";
    echo $item['school'];
    echo "</td>";
    echo "</tr>";

    echo "<tr>";
    echo "<td>";
    echo "Chỗ ở : ".$item['district']." ".$item['city'];
    echo "</td>";
    echo "</tr>";

    echo "<tr>";
    echo "<td>";
    echo "Từ Lớp : ".$item['fromclass']." đến ".$item['toclass'];
    echo "</td>";
    echo "</tr>";

    echo "<tr>";
    echo "<td>";
    echo "Môn dạy : ".$item['subjects'];
    echo "</td>";
    echo "</tr>";

    echo "<tr>";
    echo "<td>";
    echo "Thời gian dạy:".$item['teachtime'];
    echo "</td>";
    echo "</tr>";

    echo "<tr>";
    echo "<td>";
    $dtime = new DateTime($item['created']);
    echo "Đăng ngày: ".$dtime->format("d-m-Y H:i:s");
    echo "</td>";
    echo "</tr>";

    echo "<tr>";
    echo "<td>";
    echo "Trạng thái: <span style='color:white; background-color: red; padding-left:5px;padding-right: 5px;';>Chưa đi dạy</span> ";
    echo "</td>";
    echo "</tr>";
    
    echo "</table>";
    
}
?>
<br />
<div class="text_line">
<?php
       echo $this->paginationControl($this->data, 'Sliding' , 'student/pagination.phtml');
?>
</div>